import {
  // BrowserRouter as Router,
  // HashRouter as Router,
  Router,
  Route,
  Switch
} from 'react-router-dom'
// BrowserRouter = Router + BrowerHistory
import Layout from '@/pages/Layout/Layout.jsx'
import Login from '@/pages/Login/Login.jsx'
import NotFound from '@/pages/NotFound/NotFound.jsx'

import history from '@/utils/history'
import AuthRoute from '@/components/AuthRoute'

function App () {
  return (
    <div className="app">
      <Router history={history}>
        <Switch>
          <Route path="/login" component={Login} />

          <AuthRoute path="/home" component={Layout} />

          <Route component={NotFound} />
        </Switch>
      </Router>
    </div>
  )
}
export default App
